package org.redis.cluster.transport.netty.session;

import java.util.HashMap;
import java.util.Map;

import org.redis.cluster.transport.session.SessionContext;

public class NettySessionContext implements SessionContext {

	private final Map<Object,Object> context=new HashMap<Object,Object>();

	@Override
	public boolean put(Object key, Object value) {
		context.put(key, value);
		return true;
	}

	@Override
	public <T> T get(Object key) {
		return (T) context.get(key);
	}

	@Override
	public boolean remove(Object key) {
		return context.remove(key)!=null;
	}

	@Override
	public boolean clean() {
		context.clear();
		return true;
	}
}